add debian patch gdal-3.13.patch
authorDrew Parsons <dparsons@debian.org>
Fri, 8 May 2026 12:40:24 +0000 (14:40 +0200)
committerDrew Parsons <dparsons@debian.org>
Fri, 8 May 2026 12:40:24 +0000 (14:40 +0200)
enables build with gdal 3.13.
Thanks Bas Couwenberg.

Closes: #1134162
debian/changelog
debian/patches/gdal-3.13.patch [new file with mode: 0644]
debian/patches/series

index a0542dbf06891e53be9ff50d28f20dcdbd0f02bc..e1e9809466b72ea46fa4071226de70a2780be1d6 100644 (file)
@@ -6,6 +6,8 @@ vtk9 (9.5.2+dfsg4-4) UNRELEASED; urgency=medium
     endianness, int size, etc). Closes: #1133759
     Consequently drop Multi-Arch: same from libvtk9-qt-dev
     to avoid including inconsistent header definitions
+  * debian patch gdal-3.13.patch enables build with gdal 3.13.
+    Thanks Bas Couwenberg. Closes: #1134162
 
  -- Drew Parsons <dparsons@debian.org>  Thu, 07 May 2026 00:29:41 +0200
 
diff --git a/debian/patches/gdal-3.13.patch b/debian/patches/gdal-3.13.patch
new file mode 100644 (file)
index 0000000..51ee686
--- /dev/null
@@ -0,0 +1,35 @@
+Description: Fix FTBFS with GDAL 3.13.0.
+ error: invalid conversion from 'CSLConstList' {aka 'const char* const*'} to 'char**' [-fpermissive]
+ .
+ From GDAL 3.13.0 NEWS:
+ "
+  * GDALMajorObject: Use CSLConstList for GetMetadata, SetMetadata (API breakage)
+ "
+Author: Bas Couwenberg <sebastic@debian.org>
+
+--- a/IO/GDAL/vtkGDALRasterReader.cxx
++++ b/IO/GDAL/vtkGDALRasterReader.cxx
+@@ -182,7 +182,11 @@ void vtkGDALRasterReader::vtkGDALRasterR
+     this->Reader->DriverShortName = GDALGetDriverShortName(driver);
+     this->Reader->DriverLongName = GDALGetDriverLongName(driver);
++#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3, 13, 0)
++    CSLConstList papszMetaData = GDALGetMetadata(this->GDALData, nullptr);
++#else
+     char** papszMetaData = GDALGetMetadata(this->GDALData, nullptr);
++#endif
+     if (CSLCount(papszMetaData) > 0)
+     {
+       for (int i = 0; papszMetaData[i] != nullptr; ++i)
+@@ -878,7 +882,11 @@ std::vector<std::string> vtkGDALRasterRe
+ {
+   std::vector<std::string> domainMetaData;
++#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3, 13, 0)
++  CSLConstList papszMetadata = GDALGetMetadata(this->Impl->GDALData, domain.c_str());
++#else
+   char** papszMetadata = GDALGetMetadata(this->Impl->GDALData, domain.c_str());
++#endif
+   if (CSLCount(papszMetadata) > 0)
+   {
index e6c09e9e6c2bc69a80ebc32e28427d4c2ce6336c..a1f79c59ed375e6d9b842c49e3b3e460bbf035e6 100644 (file)
@@ -13,3 +13,4 @@
 121_add_support_for_loong64.patch
 findEXPAT_version_fix_MR12826.patch
 matplotlib_nullptr_s390x.patch
+gdal-3.13.patch